package fast.loader;

import fast.data.Stat;
import fast.data.StatBlock;

public class Enchant extends StatBlock {
	private String name = "";
	private String slotName = "";
	
	private boolean enchanterOnly = false;
	private boolean leatherworkerOnly = false;
	private boolean inscripterOnly = false;
	private boolean tailorOnly = false;
	private double ep;
	
	public Enchant(String n,String sn){
		this.name = n;
		this.slotName = sn;
	}
	
	public Enchant(String n,String sn, Stat stat,int value){
		this.name = n;
		this.slotName = sn;
		setStat(stat, value);
	}
	
	public Enchant(String n,String sn, Stat stat,int value,Stat stat2,int value2){
		this.name = n;
		this.slotName = sn;
		setStat(stat, value);
		setStat(stat2, value2);
	}
	
	public String getName(){
		return name;
	}

	public void setSlotName(String slotName) {
		this.slotName = slotName;
	}

	public String getSlotName() {
		return slotName;
	}
	
	public void setEnchanterOnly(boolean b){
		enchanterOnly = b;
	}
	
	public boolean isEnchanterOnly(){
		return enchanterOnly;
	}
	
	public void setLeatherworkerOnly(boolean b){
		leatherworkerOnly = b;
	}
	
	public boolean isLeatherworkerOnly(){
		return leatherworkerOnly;
	}
	
	public void setEP(double ep) {
		this.ep = ep;
	}

	public double getEP() {
		return ep;
	}
	
	public String toString(){
		String ret = "";
		for(Stat stat : Stat.possibleStats){
			if(getStat(stat) > 0)
				ret += String.format("%+.0f", this.getStat(stat)) + " " + stat.getName() + " ";
		}
		return ret.trim();
	}

	public boolean isInscripterOnly() {
		return inscripterOnly;
	}

	public void setInscripterOnly(boolean inscripterOnly) {
		this.inscripterOnly = inscripterOnly;
	}

	public boolean isTailorOnly() {
		return tailorOnly;
	}

	public void setTailorOnly(boolean tailorOnly) {
		this.tailorOnly = tailorOnly;
	}
}